//
//  HBAlbumModel.m
//  HBPhotoPicker
//
//  Created by hibo on 2019/5/20.
//  Copyright © 2019 hibo. All rights reserved.
//

#import "HBAlbumModel.h"

@implementation HBAlbumModel

-(void)setCollection:(PHAssetCollection *)collection{
    _collection = collection;
    if ([collection.localizedTitle isEqualToString:@"Camera Roll"]) {
        _title = @"相机胶卷";
    }else{
        _title = collection.localizedTitle;
    }
    //获取相册中的所有PHAsset对象
    _assetList = [PHAsset fetchAssetsInAssetCollection:collection options:nil];
    if (_assetList.count>0) {
        _coverAsset = _assetList[0];
    }
    _number = _assetList.count;
}

-(NSMutableArray<NSNumber *> *)selectRows {
    if (_selectRows==nil) {
        _selectRows = [NSMutableArray array];
    }
    return _selectRows;
}

@end
